﻿namespace DreamBuilder.Common
{
    using System;
    using System.Runtime.CompilerServices;
    using System.Runtime.Serialization;
    using System.ServiceModel;

    [DataContract]
    public class ServiceExceptionDetail : ExceptionDetail
    {
        public ServiceExceptionDetail(Exception ex) : base(ex)
        {
            this.ExceptionAssemblyQualifiedName = ex.GetType().AssemblyQualifiedName;
            if (ex.InnerException != null)
            {
                this.InnerException = new ServiceExceptionDetail(ex.InnerException);
            }
        }

        [DataMember]
        public string ExceptionAssemblyQualifiedName { get; set; }

        [DataMember]
        public ServiceExceptionDetail InnerException { get; set; }
    }
}

